package com.dkd.flow.service.impl;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dkd.flow.strategy.StrategyContext;
import com.dkd.framework.config.ApplicationConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.flow.mapper.EProcessInstancesMapper;
import com.dkd.flow.domain.EProcessInstances;
import com.dkd.flow.service.IEProcessInstancesService;
import org.springframework.web.bind.annotation.RequestBody;
/**
 * 流程实例 Service业务层处理
 *
 * @author itheima
 * @date 2025-03-02
 */
@Service
public class EProcessInstancesServiceImpl extends ServiceImpl<EProcessInstancesMapper, EProcessInstances> implements IEProcessInstancesService {
    @Autowired
    private EProcessInstancesMapper eProcessInstancesMapper;
    @Autowired
    private StrategyContext strategyContext;
    @Autowired
    private ApplicationConfig applicationConfig;
    /**
     * 查询流程实例
     *
     * @param ID 流程实例 主键
     * @return 流程实例
     */
    @Override
    public EProcessInstances selectEProcessInstancesByID(Long ID) {
        return eProcessInstancesMapper.selectEProcessInstancesByID(ID);
    }
    /**
     * 查询流程实例 列表
     *
     * @param eProcessInstances 流程实例
     * @return 流程实例
     */
    @Override
    public List<EProcessInstances> selectEProcessInstancesList(EProcessInstances eProcessInstances) {
        return eProcessInstancesMapper.selectEProcessInstancesList(eProcessInstances);
    }
    /**
     * 新增流程实例
     */
    @Override
    public Long insertEProcessInstances(@RequestBody JSONObject data) {
        Long taskId = strategyContext.execute(data);
        return taskId;
    }
    /**
     * 修改流程实例
     */
    @Override
    public Long updateEProcessInstances(JSONObject data) {
        Long taskId = strategyContext.execute(data);
        return taskId;
    }
    /**
     * 批量删除流程实例
     *
     * @param IDs 需要删除的流程实例 主键
     * @return 结果
     */
    @Override
    public int deleteEProcessInstancesByIDs(Long[] IDs) {
        return eProcessInstancesMapper.deleteEProcessInstancesByIDs(IDs);
    }
    /**
     * 删除流程实例 信息
     *
     * @param ID 流程实例 主键
     * @return 结果
     */
    @Override
    public int deleteEProcessInstancesByID(Long ID) {
        return eProcessInstancesMapper.deleteEProcessInstancesByID(ID);
    }
}
